<section data-ng-controller="SessionsController" data-ng-init="initSessionView()">
	<div class="page-header">
			<h1 data-ng-bind="session.title"></h1>
		</div>
	<button class="btn btn-default" ng-click="showSessionStartForm()">Start Session</button>
	<button class="btn btn-default" ng-click="removeSession()">Remove Session</button>
	<hr>
	<div collapse="hideStartSession">
		<div class="well well-lg">
			<h2>Select Attendees</h2>
		<div class="controls" id="chkPresenter">
			<span ng-repeat="member in groupMembers">
				<input type='checkbox'  ng-checked="session.audience.indexOf(member._id)>=0" value="{{member._id}}" ng-click="audienceSelection(member._id)"> {{member.displayName}}<br />
			</span>
			<i ng-show="groupMembers.length<=0">No members in selected group.</i>
			<!--<pre>Model: {{selectedAudience | json}}</pre>-->
		</div>
			<button class="btn btn-default" ng-click="startSession()">Start</button>
		</div>
		<hr>
	</div>
		<div class="pull-right" data-ng-show="authentication.user._id == session.user._id">
			<a class="btn btn-primary" href="/#!/sessions/{{session._id}}/edit">
				<i class="glyphicon glyphicon-edit"></i>
			</a>
			<a class="btn btn-primary" data-ng-click="remove();">
				<i class="glyphicon glyphicon-trash"></i>
			</a>
		</div>
		<small>
			<em class="text-muted">
				Scheduled on
				<span data-ng-bind="session.scheduledOn | date:'mediumDate'"></span>
			</em>
		</small>
		<p class="lead" data-ng-bind="session.content"></p>
	<div data-ng-repeat="presenter in presenters">
		<div>{{presenter.displayName}}: <rating ng-model="presenter.rate" max="5" readonly="session.audience.indexOf(authentication.user._id)<0" value="presenter.rate"  ng-click="ratePresenter(presenter.userId,presenter.rate)"></rating>
			({{presenter.rating.length}})
		</div>
	</div>
</section>
